<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateArticlesTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('articles', function(Blueprint $table)
		{
            $table->engine = 'InnoDB';
			$table->increments('id');
			$table->integer('type_id');
			$table->string('author', 20)->default('')->comment('作者');
			$table->string('title', 100)->default('')->comment('标题内容');
			$table->string('keywords', 150)->default('')->comment('关键词(多个使用英文逗号区分)');
			$table->string('excerpt', 500)->default('')->comment('文章摘要');
			$table->text('content', 65535)->nullable()->comment('文章内容');
			$table->string('thumb_image')->default('')->comment('缩略图片');
			$table->integer('view_num')->default(0)->comment('浏览数');
			$table->smallInteger('sort')->default(100)->comment('排序');
			$table->boolean('recommend')->default(2)->comment('是否推荐 1 推荐 2 不推荐');
			$table->boolean('format')->default(1)->comment('内容格式;1:html;2:md');
			$table->boolean('status')->default(0)->comment('状态;1:已发布;0:未发布; 2 关闭');
			$table->timestamps();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('articles');
	}

}
